#pragma once

#include <cuda_runtime.h>

namespace solar::cuda
{
    class RectangleGrid;

    /// @brief Intersect with heliostats in this rectangle grid.
    __host__ __device__ auto intersect(const float3& origin, const float3& dir,
                                       const float3* d_heliostat_vertices,
                                       const int* d_grid_heliostat_match, int start_id, int end_id,
                                       int subheliostat_id, int numberOfSubHeliostat) -> bool;

    __host__ __device__ auto collision(const float3& origin, const float3& dir,
                                       RectangleGrid* rect_grid_ptr,
                                       const float3* d_subheliostat_vertices, int helio_id) -> bool;
}

#if defined(SOLAR_CUDA_STANDALONE_COMPILE) && !defined(SOLAR_BUILD_SHADOW_BLOCK_COLLISION)
    #include "ShadowBlockCollision.cu"
#endif
